﻿using DDCMS.Core;
using DDCMS.Core.IRepository;
using DDCMS.Domain;
using DDCMS.Domain.Manager;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DDCMS.EntityFrameworkCore
{
    public  class CMSContext: IdentityDbContext<User>
    {

     
        public CMSContext(DbContextOptions<CMSContext> opt) : base(opt)
        {


        }
       
      
        public virtual DbSet<Category> Category { get; set; }
        public virtual DbSet<DicDetail> DicDetail { get; set; }
        public virtual DbSet<DicIndex> DicIndex { get; set; }
        public virtual DbSet<CommonApply> CommonApply { get; set; }
        public virtual DbSet<Module> Module { get; set; }
        public virtual DbSet<ModuleElement> ModuleElement { get; set; }
        public virtual DbSet<Org> Org { get; set; }
        public virtual DbSet<Relevance> Relevance { get; set; }
        public virtual DbSet<Resource> Resource { get; set; }
        public virtual DbSet<Role> Role { get; set; }
        public virtual DbSet<User> User { get; set; }
        protected override void  OnModelCreating(ModelBuilder modelBuilder) {
           
            modelBuilder.Entity<User>().ForMySqlToTable("User");
            modelBuilder.Entity<Role>().ForMySqlToTable("Role");
            modelBuilder.Entity<Category>().ForMySqlToTable("Category");
            base.OnModelCreating(modelBuilder);

        }

    }
   

}
